var SPSdk = (function () {
    var PAY_URL = "http://app.hi66.com/app/opening/hiCurrencyConsumption.html";
    function SPSdk() {
        this.appId = "";
        this.appKey = "";
        this.otherKey = "";
        this.queryParams = {};
        this.userID = "";
    }
    var __proto = SPSdk.prototype;
    __proto.login = function (param, callback) {
        var m_this = this;
        console.log("嗨乐登录：" + JSON.stringify(param));
        m_this.userID =  m_this.queryParams.memberId;
        callback && callback({"result":0,"spuid":m_this.userID,"nickname":m_this.queryParams.userName, "img":m_this.queryParams.userImg});
    }
    
    __proto.pay = function (param, callback) {
        var m_this = this;
        console.log("嗨乐支付：" + JSON.stringify(param));
        if(window.HLWKWwebVC && window.HLWKWwebVC.TestWebGameIdPriceNotifyUrlAppIdOrderIdAppKey)
        {
            window.HLWKWwebVC.TestWebGameIdPriceNotifyUrlAppIdOrderIdAppKey(m_this.otherKey,param.data.amount/100,param.data.other.notifyUrl,m_this.appId,param.data.orderId,m_this.appKey);
        }
        else if(window.contact && window.contact.deduct)
        {
            window.contact.deduct(m_this.appKey,m_this.appId,param.data.amount/100,param.data.orderId,param.data.other.notifyUrl,param.data.other.severId,m_this.otherKey);
        }
    };
    __proto.init = function (param, callback) {
        console.log("嗨乐初始化：" + JSON.stringify(param));
        var m_this = this;
        m_this.appId = param.appId;
        m_this.appKey = param.appKey;
        m_this.otherKey = param.other;
        m_this.queryParams = param.queryParams;
        callback && callback({"result": 0, "desc": "OK"});
    };
    return SPSdk;
})();